#ifndef TEMPLATEXPLCLASS_H
#define TEMPLATEXPLCLASS_H

#include <QString>
#include <TemplatexPLItem.h>
#include <QList>

class TemplatexPLClass
{
private:
    QString name;
    bool allowCommand;
    bool allowTrigger;
    bool allowStatus;
    QList<TemplatexPLItem> itemList;

public:
    TemplatexPLClass();
    TemplatexPLClass(const QString& name);
    TemplatexPLClass(const QString& name, bool allowCommand, bool allowTrigger, bool allowStatus);
    TemplatexPLClass(const QString &name, bool allowCommand, bool allowTrigger, bool allowStatus,
                     const QList<TemplatexPLItem>& itemList);
    TemplatexPLClass(const TemplatexPLClass& other);
    virtual ~TemplatexPLClass();
    TemplatexPLClass& operator=(const TemplatexPLClass& other);
    bool equals(const TemplatexPLClass& other) const;
    virtual QString toString() const;
    virtual QString toXml() const;
    const QString& getName() const { return name; }
    void setName(const QString& name) { this->name = name; }
    bool isAcceptCommand() const { return allowCommand; }
    void setAcceptCommand(bool accept) { allowCommand = accept; }
    bool isAcceptTrigger() const { return allowTrigger; }
    void setAcceptTrigger(bool accept) { allowTrigger = accept; }
    bool isAcceptStatus() const { return allowStatus; }
    void setAcceptStatus(bool accept) { allowStatus = accept; }
    const QList<TemplatexPLItem>& items() const { return itemList; }
    QList<TemplatexPLItem>& items() { return itemList; }
};

bool operator==(const TemplatexPLClass& a, const TemplatexPLClass& b);
bool operator!=(const TemplatexPLClass& a, const TemplatexPLClass& b);

#endif // TEMPLATEXPLCLASS_H
